package com.qianfeng.shopping.util;
// 工具类  用来提供验证码
public class VerificationCode {
	public static String getCode() {
		String code = "";
		char[] arr = new char[62];
		for(int i=0;i<26;i++) {
			arr[i] = (char)(65+i);
		}
		for(int i=26;i<52;i++) {
			arr[i] = (char)(97+i-26);
		}
		for(int i=52;i<arr.length;i++) {
			arr[i] = (char)(48+i-52);
		}
		for(int i=1;i<=4;i++) {
			int index = (int)(Math.random()*arr.length);
			code = code +arr[index];
		}
		return code;
	}
}
